<?php
session_cache_expire(999999999);
if(!isset($_SESSION)){ 
	session_start(); 
} 
if(!isset($_SESSION['user'])){
	echo "timeout";
}else{

	$username = $_SESSION['fullname'];
	$id_employee = $_SESSION['IDEmployee'];

$arraytester = $_REQUEST['arraytester'];
$namepro = $_REQUEST['namepro'];

//echo "arr =".$arraytester;
if($arraytester!=''){
	$addressbrowser = $_SERVER['SERVER_NAME'];
			$temp = explode(".", $addressbrowser);
			$lang=$_SESSION['lang'];
			if($lang==''){
				$lang='EN';
				$_SESSION['lang']="EN";
			}

			$url = 'http://1.234.53.52/mail/mail_newversion.php';
			$fields = array(
									'company' => urlencode($temp[0]),
									'lang' => urlencode($lang),
									'from' => urldecode($username),
									'nameproject' => urldecode($namepro),
									'listtester' => urlencode($arraytester)
							);
			/*$url = 'http://localhost/mail/mail_newversion.php';
			$fields = array(
									'company' => urlencode('elitech'),
									'lang' => urlencode($lang),
									'from' => urldecode($username),
									'nameproject' => urldecode($namepro),
									'listtester' => urlencode($arraytester)
							);*/
			foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
			rtrim($fields_string, '&');
			$ch = curl_init();
			curl_setopt($ch,CURLOPT_URL, $url);
			curl_setopt($ch,CURLOPT_POST, count($fields));
			curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
			$result = curl_exec($ch);
			curl_close($ch);
}
}
?>